package com.qiyue.admin.biz.base.log;

import com.qiyue.admin.entity.base.log.BizLogDateilEntity;
import com.qiyue.admin.entity.base.log.BizLogEntity;
import com.qiyue.admin.repository.base.log.BizLogRepository;
import com.qiyue.common.biz.BaseBiz;
import com.qiyue.common.model.BizResultModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * created by yebinghuan on 2018/3/29
 */
@Service
public class BizLogBiz extends BaseBiz<BizLogRepository, BizLogEntity ,Long > {

    @Autowired
    private BizLogDateilBiz bizLogDateilBiz;


    /**
     *  记录日志
     * @param model
     * @param entity
     * @throws IllegalAccessException
     */
    public void saveBizLog(BizResultModel model, BizLogEntity entity) throws IllegalAccessException {
        bizLogDateilBiz.saveLog(model.getObj(),  this.save(entity),model.isList());
    }


}
